package utility;

import java.util.Enumeration;
import java.util.Hashtable;


public class ComapreHashtabel 
{
	
	public static boolean CompareHashtable(Hashtable<Object, Object>temp1,Hashtable<Object, Object>temp2,String field)
	{
		  if(temp1.containsKey(field) &&  temp2.containsKey(field))
			 if(temp1.get(field).toString().toLowerCase().equals(temp2.get(field).toString().toLowerCase()))
				 return true;
		 return false; 
	}
	
	public static boolean CompareHashtable(Hashtable<Object, Object>temp1,Hashtable<Object, Object>temp2)
	{	
		if(temp1.size()!=temp2.size())
			return false;
		else
		{
			Enumeration<Object> enume = temp1.keys();
			while(enume.hasMoreElements())
			{
				String key = enume.nextElement().toString();
				if(temp2.containsKey(key))
				{
					if(!temp2.get(key).toString().equalsIgnoreCase(temp1.get(key).toString()))
						    return false;     
				}
				else
					return false;
			}
		}	
		return true;
	}
	
}
